package com.maidada.mddaichat.controller;

import com.maidada.mddaichat.dto.chat.ChatSendMsgRequest;
import com.maidada.mddaichat.service.ChatService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;

import javax.validation.Valid;

/**
 * 聊天管理
 *
 * @author wulinxuan
 * @date 2025-04-16 17:22
 */
@Slf4j
@RestController
@RequestMapping("/chat")
@RequiredArgsConstructor
public class ChatController {

    private final ChatService chatService;

    @GetMapping(value = "/send")
    public SseEmitter sendMsg(@Valid ChatSendMsgRequest param) {
        return chatService.sendMessage(param);
    }
}
